package com.baiku.sanhos.mapper;

import com.baiku.sanhos.pojo.dto.AppointDTO;
import com.baiku.sanhos.pojo.entity.Appoint;
import com.baiku.sanhos.pojo.vo.AppointDetailVO;
import com.baiku.sanhos.pojo.vo.AppointVo;
import com.baiku.sanhos.pojo.vo.FutureWeekendDateVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface AppointMapper extends BaseMapper<Appoint> {
    /**
     * 增：增加排班日期
     * @param appointDTO
     */
    void addAppoint(AppointDTO appointDTO);

    /**
     * 增：添加排班 去掉了医生工号 移动到了号源表
     *
     */
    List<FutureWeekendDateVO> getFutureWeekendDateByDeptId(Integer deptId);

    /**
     * 查：根据科室查询当前日期到未来七天的排版日期数据
     * @param deptId
     * @return
     */
    List<FutureWeekendDateVO> getFutureWeekendDate(Integer deptId);

    List<Appoint> selectAppoint(String no);

    /**
     * 查：获取全部排班信息并渲染号源
     * @param no
     * @param schedulTime
     * @return
     */
    int getTotalDepts(String no, String schedulTime);

    /**
     * 查：获取全部排班信息
     * @param pageSize
     * @param offset
     * @param no
     * @param schedulTime
     * @return
     */
    List<AppointVo> selectAll(int pageSize, int offset, String no, String schedulTime);

    /**
     * 查：查询一次排班日期
     * @param schedultime
     * @return
     */
    int queryOneFindByTime(AppointDTO appointDTO);

    /**
     * 查：查询全部号源信息
     * @param id
     * @return
     */
    int selectSourceTotal(Integer id);

    /**
     * 查： 根据科室ID查询近一周的排班日期
     * @param doctorNo
     * @return
     */
    List<FutureWeekendDateVO> getFutureWeekendDateByDoctorNo(String doctorNo);

    /**
     * 改：根据id编辑排班信息
     * @param appointDTO
     */
    void updateAppointById(AppointDTO appointDTO);

    /**
     * 改：根据ids批量修改发布状态
     * @param ids
     */
    void updateByIds(List<Integer> ids);
    List<AppointDetailVO> selectAllAppoint(int pageSize, int offset, String scheduleTime);
    int getTotalAppoints(String scheduleTime);
    List<AppointDetailVO> selectAllAppointScheduleTime(String scheduleTime);

    Appoint queryByAppointFindDoctorNo(Integer appointId);
}
